package config

type Server struct {
	Mysql          Mysql  `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	Redis          Redis  `mapstructure:"redis" json:"redis" yaml:"redis"`
	Log            Log    `mapstructure:"log" json:"log" yaml:"log"`
	LogRus         LogRus `mapstructure:"logrus" json:"log" yaml:"logrus"`
	App            App    `mapstructure:"app" json:"system" yaml:"app"`
	PlayGroundPool GoPool `mapstructure:"goplayground-pool" json:"goplaygroundPool" yaml:"goplayground-pool"`
}

type App struct {
	Name string `mapstructure:"name" json:"name" yaml:"name"`
	Env  string `mapstructure:"env" json:"env" yaml:"env"`
}
type Mysql struct {
	Username     string `mapstructure:"username" json:"username" yaml:"username"`
	Password     string `mapstructure:"password" json:"password" yaml:"password"`
	Path         string `mapstructure:"path" json:"path" yaml:"path"`
	Dbname       string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
	Config       string `mapstructure:"config" json:"config" yaml:"config"`
	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
	MaxOpenConns int    `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
	LogMode      bool   `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
}

type Redis struct {
	Network  string `mapstructure:"network" json:"network" yaml:"network"`
	Addr     string `mapstructure:"addr" json:"addr" yaml:"addr"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
	DB       int    `mapstructure:"db" json:"db" yaml:"db"`
}

type Log struct {
	Prefix      string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
	LogFile     bool   `mapstructure:"log-file" json:"logFile" yaml:"log-file"`
	Stdout      string `mapstructure:"stdout" json:"stdout" yaml:"stdout"`
	File        string `mapstructure:"file" json:"file" yaml:"file"`
	LogDir      string `mapstructure:"log-dir" json:"logDir" yaml:"log-dir"`
	LogModule   string `mapstructure:"log-module" json:"logModule" yaml:"log-module"`
	LogSoftLink string `mapstructure:"log-soft-link" json:"logSoftLink" yaml:"log-soft-link"`
}

type LogRus struct {
	Prefix      string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
	LogFile     bool   `mapstructure:"log-file" json:"logFile" yaml:"log-file"`
	Stdout      string `mapstructure:"stdout" json:"stdout" yaml:"stdout"`
	File        string `mapstructure:"file" json:"file" yaml:"file"`
	LogDir      string `mapstructure:"log-dir" json:"logDir" yaml:"log-dir"`
	LogModule   string `mapstructure:"log-module" json:"logModule" yaml:"log-module"`
	LogSoftLink string `mapstructure:"log-soft-link" json:"logSoftLink" yaml:"log-soft-link"`
}

type GoPool struct {
	LimitWorks uint `mapstructure:"work-limit" json:"workLimit" yaml:"work-limit"`
}
